<?php echo $this->render('header.phtml'); ?>
<div id="content">
    <div id="article-<?php echo $this->escape($this->article->info->articleId) ?>" class="articleContent">
        <div id="article-title-<?php echo $this->escape($this->article->info->articleId) ?>" class="article_head">
            <h2>
                <a href="/article/<?php echo $this->escape($this->article->info->articleId) ?>-1.html"><?php echo $this->escape($this->article->info->articleTitle) ?></a>
            </h2>
        </div>
        <div id="article-property-<?php echo $this->escape($this->article->info->articleId) ?>" class="article_property">
            <span class="article_prop_category"><a href="/category/<?php echo $this->escape($this->article->category->categoryId) ?>-1.html" title="<?php echo $this->escape($this->article->category->categoryName) ?>"><?php echo $this->escape($this->article->category->categoryName) ?></a></span>
            <span class="article_prop_date"><?php echo $this->escape($this->article->info->publishTime) ?></span>
            <span class="article_prop_views"><?php echo $this->escape($this->article->info->clickCount)?> 人阅读</span>
            <span class="article_prop_tags">
                <?php foreach ($this->article->tags as $key => $tag) : ?>
                <a href="/tag/<?php echo $this->escape($tag->tagId) ?>-1.html" rel="tag"><?php echo $this->escape($tag->tagName) ?></a>
                <?php endforeach; ?>
            </span>
        </div>
        <div id="article-description-<?php echo $this->escape($this->article->info->articleId) ?>" class="article_description">
            <?php echo $this->article->info->articleSummary ?>
        </div>
        <div id="article-content-<?php echo $this->escape($this->article->info->articleId) ?>" class="article_text">
            <!-- google_ad_section_start -->
            <?php echo $this->article->info->articleContent ?>
            <!-- google_ad_section_end -->
            <p>--EOF--</p>
            <p>&nbsp;</p>
        </div>

        <div id="article-comments-<?php echo $this->escape($this->article->info->articleId) ?>" class="article_comments">
            <h3><?php echo $this->escape($this->article->info->commentCount) ?>条 关于日志 &#8220;<?php echo $this->escape($this->article->info->articleTitle) ?>&#8221; 的评论</h3>
            <div class="comments">
                <?php if (count($this->comments)) : ?>
                    <?php foreach ($this->comments as $comment) : ?>
                <div id="comment-<?php echo $this->escape($comment->commentId) ?>" class="comment">
                    <img src="/public/image/avatar/avatar.png" class="avatar" alt="头像"/>
                    <div class="comment_content">
                        <strong><?php echo $this->escape($comment->nickname)?></strong> Says @ <?php echo $this->escape($comment->replyTime) ?>
                        <p><?php echo $comment->comment ?></p>
                    </div>
                </div>
                    <?php endforeach; ?>
                    <?php echo $this->paginationControl($this->comments,'Elastic','pagebar.phtml'); ?>
                <?php endif; ?>
            </div>

            <form action="/comment/index/" method="post" id="commentform" onsubmit="return submitForm();">
                <h3>发表您的评论</h3>
                <p>
                    <label for="nickname">昵称</label>
                </p>
                <p>
                    <input id="nickname" type="text" tabindex="1" size="20" value="" name="nickname"/>
                </p><p>
                    <label for="comment">评论内容</label>
                </p><p><textarea id="comment" tabindex="4" rows="5" cols="60" name="comment"></textarea></p>
                <p>
                    <label>
                        <img title="验证码" alt="验证码" src="/script/createcaptcha/"/>
                        <input id="captcha" type="text" maxlength="5" size="5" name="captcha"/>
                    </label>
                </p>
                <p>
                    <input type="hidden" name="comment_post_id" value="<?php echo $this->escape($this->article->info->articleId) ?>" />
                    <input type="hidden" name="comment_page_id" value="<?php echo $this->escape($this->page) ?>" />
                    <input id="submit" type="submit" value="留言" tabindex="5" name="submit"/>
                </p>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
    function submitForm(){
        if($("#nickname").val() == ''){
		alert('请留下您的昵称!');
		$("#nickname").focus();
		return false;
	} else if ($("#comment").val() == '') {
		alert('请添加您的想法!');
		$("#comment").focus();
		return false;
	} else if ($("#captcha").val() == '') {
		alert('不要当注册机哦!^_^');
		$("#captcha").focus();
		return false;
	} else if ($("#author").val() != '' && $("#comment").val() != '' && $("#captcha").val() != ''){
		return true;
	}
    }
</script>
<script type="text/javascript" src="/script/stat/id/<?php echo $this->escape($this->article->info->articleId) ?>/"></script>
<script type="text/javascript" src="/public/js/shCore.js"></script>
<script type="text/javascript" src="/public/js/shBrush.js"></script>
<script type="text/javascript">
    SyntaxHighlighter.config.clipboardSwf = '/public/swf/clipboard.swf';
    SyntaxHighlighter.all();
</script>
<?php echo $this->render('navibar.phtml'); ?>
<?php echo $this->render('footer.phtml'); ?>